﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using HCI.Questionaire.Exceptions;
using System.Collections.Generic;

namespace HCI.Questionaire.Entities
{
    public class RatingQuestionGroup : Question
    {
        #region Feild
        private List<RatingQuestion> questionList;
        #endregion

        #region Property
        public List<RatingQuestion> QuestionList
        {
            get
            {
                if (questionList == null)
                    questionList = new List<RatingQuestion>();

                return this.questionList;
            }
        }
        #endregion

        #region Method: Public
        public void Add(RatingQuestion q)
        {
            q.AnswerValueChange += ans => { this.OnAnswerValueChange(ans); };
            this.QuestionList.Add(q);
        }

        public List<RatingQuestion> GetQuestionList()
        {
            return questionList;
        }

        public override void ValidateAnswer()
        {
            this.questionList.ForEach(o => o.ValidateAnswer());
        }
        #endregion
    }
}
